home *** CD-ROM | disk | FTP | other *** search
- Path: cs.tu-berlin.de!news
- From: Ingo Meneikis <meneikis@cs.tu-berlin.de>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: silly c problem
- Date: Wed, 31 Jan 1996 11:55:36 +0100
- Organization: TU Berlin
- Message-ID: <310F4AA8.63E6@cs.tu-berlin.de>
- References: <f2c_9601302132@techtol.magic.mb.ca>
- NNTP-Posting-Host: malaria.cs.tu-berlin.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-2
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b5 (X11; I; SunOS 5.4 sun4m)
-
- Tahir Khawaja wrote:
- > scanf("%d%d", &num1, &num2);
- ^ ^ - O.K.
- > printf("You entered %d and %d.\n\n", &num1, &num2);
- ^ ^
- You want to type out the addresses of the int variables!
- For scanf it's o.k. - here you have to give the addresses of
- the variables, you want to scan in. Because C doesn't support
- call by reference. (Pascal : VAR INTEGER x )
- But for printf, there you have to give the variable names as
- argument! printf doesn't give back any values except the return value.
-
- > printf("The result is %d %d %d %d\n.", &num1, &num2, &res, &err);
- ^ ^ ^ ^
- see above
-
-
- Hope I could help you.
-
- And hope you understand my English.
-
- Ingo
-